package com.betterjr.modules.risk.loanmanage.entity;

import java.math.BigDecimal;
import java.sql.Timestamp;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.betterjr.common.annotation.MetaData;
import com.betterjr.common.entity.BetterjrEntity;

@Access(AccessType.FIELD)
@Entity
@Table(name = "t_partnership")
public class Partnership implements BetterjrEntity {
    public static final String selectKey = "Partnership.id";

    /**
     * ID
     */
    @Id
    @Column(name = "ID", columnDefinition = "INTEGER")
    @MetaData(value = "ID", comments = "ID")
    private Long id;

    /**
     * 核心企业ID
     */
    @Column(name = "N_CORE_COMPANY_ID", columnDefinition = "INTEGER")
    @MetaData(value = "核心企业ID", comments = "核心企业ID")
    private Long coreCompanyId;

    /**
     * 核心企业名称
     */
    @Column(name = "C_CORE_COMPANY_NAME", columnDefinition = "VARCHAR")
    @MetaData(value = "核心企业名称", comments = "核心企业名称")
    private String coreCompanyName;

    /**
     * 开始时间
     */
    @Column(name = "D_START_DATE", columnDefinition = "DATETIME")
    @MetaData(value = "开始时间", comments = "开始时间")
    private Timestamp startDate;

    /**
     * 结束时间
     */
    @Column(name = "D_END_DATE", columnDefinition = "DATETIME")
    @MetaData(value = "结束时间", comments = "结束时间")
    private Timestamp endDate;

    /**
     * 长期有效标志： 0 长期有效
     */
    @Column(name = "C_VALIDFLAG", columnDefinition = "CHAR")
    @MetaData(value = "长期有效标志： 0 长期有效", comments = "长期有效标志： 0 长期有效")
    private String validflag;

    /**
     * 合作协议方式
     */
    @Column(name = "C_COOPERATION_AGREEMENT_MODE", columnDefinition = "CHAR")
    @MetaData(value = "合作协议方式", comments = "合作协议方式")
    private String cooperationAgreementMode;

    /**
     * 合作协议名称
     */
    @Column(name = "N_COOPERATION_AGREEMENT_NAME", columnDefinition = "VARCHAR")
    @MetaData(value = "合作协议名称", comments = "合作协议名称")
    private String cooperationAgreementName;

    /**
     * 合作协议明细ID
     */
    @Column(name = "N_COOPERATION_AGREEMENT_ID", columnDefinition = "INTEGER")
    @MetaData(value = "合作协议明细ID", comments = "合作协议明细ID")
    private Long cooperationAgreementId;

    /**
     * 合作协议模板ID
     */
    @Column(name = "N_COOPERATION_AGREEMENT_TEMPLATE_ID", columnDefinition = "INTEGER")
    @MetaData(value = "合作协议模板ID", comments = "合作协议模板ID")
    private Long cooperationAgreementTemplateId;

    /**
     * 分润比例 0.4 
     */
    @Column(name = "N_PROFIT_RATIO", columnDefinition = "DECIMAL")
    @MetaData(value = "分润比例 0.4 ", comments = "分润比例 0.4 ")
    private BigDecimal profitRatio;

    /**
     * 银行账号ID
     */
    @Column(name = "P_BANK_ACCOUNT_ID", columnDefinition = "INTEGER")
    @MetaData(value = "银行账号ID", comments = "银行账号ID")
    private Long bankAccountId;

    /**
     * 账户名称
     */
    @Column(name = "C_ACCOUNT_NAME", columnDefinition = "VARCHAR")
    @MetaData(value = "账户名称", comments = "账户名称")
    private String accountName;

    /**
     * 账户帐号
     */
    @Column(name = "C_ACCOUNT_NO", columnDefinition = "VARCHAR")
    @MetaData(value = "账户帐号", comments = "账户帐号")
    private String accountNo;

    /**
     * 开户行
     */
    @Column(name = "C_ACCOUNT_BANK", columnDefinition = "VARCHAR")
    @MetaData(value = "开户行", comments = "开户行")
    private String accountBank;

    /**
     * 联行号
     */
    @Column(name = "C_BANK_NO", columnDefinition = "VARCHAR")
    @MetaData(value = "联行号", comments = "联行号")
    private String bankNo;

    /**
     * 结算方式 0 季度 1按月
     */
    @Column(name = "C_PAYMENT_MODE", columnDefinition = "CHAR")
    @MetaData(value = "结算方式 0 季度 1按月", comments = "结算方式 0 季度 1按月")
    private String paymentMode;

    /**
     * 状态 0有效 1 无效
     */
    @Column(name = "C_STATUS", columnDefinition = "CHAR")
    @MetaData(value = "状态 0有效 1 无效", comments = "状态 0有效 1 无效")
    private String status;

    /**
     * 创建时间
     */
    @Column(name = "D_CREATE_DATE", columnDefinition = "DATETIME")
    @MetaData(value = "创建时间", comments = "创建时间")
    private Timestamp createDate;

    /**
     * 创建人
     */
    @Column(name = "C_CREATOR", columnDefinition = "VARCHAR")
    @MetaData(value = "创建人", comments = "创建人")
    private String creator;

    /**
     * 创建人ID
     */
    @Column(name = "N_CREATOR_ID", columnDefinition = "INTEGER")
    @MetaData(value = "创建人ID", comments = "创建人ID")
    private Long creatorId;

    private static final long serialVersionUID = 1530085037594L;

    public Long getId() {
        return id;
    }

    public void setId(final Long id) {
        this.id = id;
    }

    public Long getCoreCompanyId() {
        return coreCompanyId;
    }

    public void setCoreCompanyId(final Long coreCompanyId) {
        this.coreCompanyId = coreCompanyId;
    }

    public String getCoreCompanyName() {
        return coreCompanyName;
    }

    public void setCoreCompanyName(final String coreCompanyName) {
        this.coreCompanyName = coreCompanyName;
    }

    public Timestamp getStartDate() {
        return startDate;
    }

    public void setStartDate(final Timestamp startDate) {
        this.startDate = startDate;
    }

    public Timestamp getEndDate() {
        return endDate;
    }

    public void setEndDate(final Timestamp endDate) {
        this.endDate = endDate;
    }

    public String getValidflag() {
        return validflag;
    }

    public void setValidflag(final String validflag) {
        this.validflag = validflag;
    }

    public String getCooperationAgreementMode() {
        return cooperationAgreementMode;
    }

    public void setCooperationAgreementMode(final String cooperationAgreementMode) {
        this.cooperationAgreementMode = cooperationAgreementMode;
    }

    public String getCooperationAgreementName() {
        return cooperationAgreementName;
    }

    public void setCooperationAgreementName(final String cooperationAgreementName) {
        this.cooperationAgreementName = cooperationAgreementName;
    }

    public Long getCooperationAgreementId() {
        return cooperationAgreementId;
    }

    public void setCooperationAgreementId(final Long cooperationAgreementId) {
        this.cooperationAgreementId = cooperationAgreementId;
    }

    public Long getCooperationAgreementTemplateId() {
        return cooperationAgreementTemplateId;
    }

    public void setCooperationAgreementTemplateId(final Long cooperationAgreementTemplateId) {
        this.cooperationAgreementTemplateId = cooperationAgreementTemplateId;
    }

    public BigDecimal getProfitRatio() {
        return profitRatio;
    }

    public void setProfitRatio(final BigDecimal profitRatio) {
        this.profitRatio = profitRatio;
    }

    public Long getBankAccountId() {
        return bankAccountId;
    }

    public void setBankAccountId(final Long bankAccountId) {
        this.bankAccountId = bankAccountId;
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(final String accountName) {
        this.accountName = accountName;
    }

    public String getAccountNo() {
        return accountNo;
    }

    public void setAccountNo(final String accountNo) {
        this.accountNo = accountNo;
    }

    public String getAccountBank() {
        return accountBank;
    }

    public void setAccountBank(final String accountBank) {
        this.accountBank = accountBank;
    }

    public String getBankNo() {
        return bankNo;
    }

    public void setBankNo(final String bankNo) {
        this.bankNo = bankNo;
    }

    public String getPaymentMode() {
        return paymentMode;
    }

    public void setPaymentMode(final String paymentMode) {
        this.paymentMode = paymentMode;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(final String status) {
        this.status = status;
    }

    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(final Timestamp createDate) {
        this.createDate = createDate;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(final String creator) {
        this.creator = creator;
    }

    public Long getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(final Long creatorId) {
        this.creatorId = creatorId;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", coreCompanyId=").append(coreCompanyId);
        sb.append(", coreCompanyName=").append(coreCompanyName);
        sb.append(", startDate=").append(startDate);
        sb.append(", endDate=").append(endDate);
        sb.append(", validflag=").append(validflag);
        sb.append(", cooperationAgreementMode=").append(cooperationAgreementMode);
        sb.append(", cooperationAgreementName=").append(cooperationAgreementName);
        sb.append(", cooperationAgreementId=").append(cooperationAgreementId);
        sb.append(", cooperationAgreementTemplateId=").append(cooperationAgreementTemplateId);
        sb.append(", profitRatio=").append(profitRatio);
        sb.append(", bankAccountId=").append(bankAccountId);
        sb.append(", accountName=").append(accountName);
        sb.append(", accountNo=").append(accountNo);
        sb.append(", accountBank=").append(accountBank);
        sb.append(", bankNo=").append(bankNo);
        sb.append(", paymentMode=").append(paymentMode);
        sb.append(", status=").append(status);
        sb.append(", createDate=").append(createDate);
        sb.append(", creator=").append(creator);
        sb.append(", creatorId=").append(creatorId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(final Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        final Partnership other = (Partnership) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getCoreCompanyId() == null ? other.getCoreCompanyId() == null
                        : this.getCoreCompanyId().equals(other.getCoreCompanyId()))
                && (this.getCoreCompanyName() == null ? other.getCoreCompanyName() == null
                        : this.getCoreCompanyName().equals(other.getCoreCompanyName()))
                && (this.getStartDate() == null ? other.getStartDate() == null
                        : this.getStartDate().equals(other.getStartDate()))
                && (this.getEndDate() == null ? other.getEndDate() == null
                        : this.getEndDate().equals(other.getEndDate()))
                && (this.getValidflag() == null ? other.getValidflag() == null
                        : this.getValidflag().equals(other.getValidflag()))
                && (this.getCooperationAgreementMode() == null ? other.getCooperationAgreementMode() == null
                        : this.getCooperationAgreementMode().equals(other.getCooperationAgreementMode()))
                && (this.getCooperationAgreementName() == null ? other.getCooperationAgreementName() == null
                        : this.getCooperationAgreementName().equals(other.getCooperationAgreementName()))
                && (this.getCooperationAgreementId() == null ? other.getCooperationAgreementId() == null
                        : this.getCooperationAgreementId().equals(other.getCooperationAgreementId()))
                && (this.getCooperationAgreementTemplateId() == null ? other.getCooperationAgreementTemplateId() == null
                        : this.getCooperationAgreementTemplateId().equals(other.getCooperationAgreementTemplateId()))
                && (this.getProfitRatio() == null ? other.getProfitRatio() == null
                        : this.getProfitRatio().equals(other.getProfitRatio()))
                && (this.getBankAccountId() == null ? other.getBankAccountId() == null
                        : this.getBankAccountId().equals(other.getBankAccountId()))
                && (this.getAccountName() == null ? other.getAccountName() == null
                        : this.getAccountName().equals(other.getAccountName()))
                && (this.getAccountNo() == null ? other.getAccountNo() == null
                        : this.getAccountNo().equals(other.getAccountNo()))
                && (this.getAccountBank() == null ? other.getAccountBank() == null
                        : this.getAccountBank().equals(other.getAccountBank()))
                && (this.getBankNo() == null ? other.getBankNo() == null : this.getBankNo().equals(other.getBankNo()))
                && (this.getPaymentMode() == null ? other.getPaymentMode() == null
                        : this.getPaymentMode().equals(other.getPaymentMode()))
                && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
                && (this.getCreateDate() == null ? other.getCreateDate() == null
                        : this.getCreateDate().equals(other.getCreateDate()))
                && (this.getCreator() == null ? other.getCreator() == null
                        : this.getCreator().equals(other.getCreator()))
                && (this.getCreatorId() == null ? other.getCreatorId() == null
                        : this.getCreatorId().equals(other.getCreatorId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCoreCompanyId() == null) ? 0 : getCoreCompanyId().hashCode());
        result = prime * result + ((getCoreCompanyName() == null) ? 0 : getCoreCompanyName().hashCode());
        result = prime * result + ((getStartDate() == null) ? 0 : getStartDate().hashCode());
        result = prime * result + ((getEndDate() == null) ? 0 : getEndDate().hashCode());
        result = prime * result + ((getValidflag() == null) ? 0 : getValidflag().hashCode());
        result = prime * result
                + ((getCooperationAgreementMode() == null) ? 0 : getCooperationAgreementMode().hashCode());
        result = prime * result
                + ((getCooperationAgreementName() == null) ? 0 : getCooperationAgreementName().hashCode());
        result = prime * result + ((getCooperationAgreementId() == null) ? 0 : getCooperationAgreementId().hashCode());
        result = prime * result
                + ((getCooperationAgreementTemplateId() == null) ? 0 : getCooperationAgreementTemplateId().hashCode());
        result = prime * result + ((getProfitRatio() == null) ? 0 : getProfitRatio().hashCode());
        result = prime * result + ((getBankAccountId() == null) ? 0 : getBankAccountId().hashCode());
        result = prime * result + ((getAccountName() == null) ? 0 : getAccountName().hashCode());
        result = prime * result + ((getAccountNo() == null) ? 0 : getAccountNo().hashCode());
        result = prime * result + ((getAccountBank() == null) ? 0 : getAccountBank().hashCode());
        result = prime * result + ((getBankNo() == null) ? 0 : getBankNo().hashCode());
        result = prime * result + ((getPaymentMode() == null) ? 0 : getPaymentMode().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getCreator() == null) ? 0 : getCreator().hashCode());
        result = prime * result + ((getCreatorId() == null) ? 0 : getCreatorId().hashCode());
        return result;
    }
}